//
// Created by 19854 on 23/04/30.
//

#include "WS2812Task.h"
TaskHandle_t WS2812TaskHand;
void WS2812Task(void *ptParam)
{
    Freenove_ESP32_WS2812 strip = Freenove_ESP32_WS2812(LEDS_COUNT, LEDS_PIN, CHANNEL, TYPE_GRB);
    u8 m_color[5][3] = {{255, 0,   0},
                        {0,   255, 0},
                        {0,   0,   255},
                        {255, 255, 255},
                        {0,   0,   0}};
    int delayval = 100;
    strip.begin();
    strip.setBrightness(10);
    while (true)
    {
        for (int j = 0; j < 5; j++)
        {
            for (int i = 0; i < LEDS_COUNT; i++)
            {
                strip.setLedColorData(i, m_color[j][0], m_color[j][1], m_color[j][2]);
                strip.show();
                delay(delayval);
            }
            vTaskDelay(500);
        }
    }
}